From bfab004a6f4f85b9ce2a482ca0d3c8f36c06b65d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 29 Dec 2003 11:39:44 +0000 Subject: [PATCH] (insert-for-yank): Call insert-for-yank-1 repetitively for each yank-handler segment. (insert-for-yank-1): New function, with the body of the previous insert-for-yank. --- lisp/subr.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index 2996f2903e0..e760936572b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1563,7 +1563,18 @@ Replaces `category' properties with their defined properties." (defvar yank-undo-function) (defun insert-for-yank (string) + "Calls `insert-for-yank-1' repetitively for each `yank-handler' segment. + +See `insert-for-yank-1' for more details." + (let (to) + (while (setq to (next-single-property-change 0 'yank-handler string)) + (insert-for-yank-1 (substring string 0 to)) + (setq string (substring string to)))) + (insert-for-yank-1 string)) + +(defun insert-for-yank-1 (string) "Insert STRING at point, stripping some text properties. + Strip text properties from the inserted text according to `yank-excluded-properties'. Otherwise just like (insert STRING). -- 2.30.2